<html>
<head>
<link href="../enzo.css" rel="stylesheet" type="text/css">
   <title>Enzo user's guide: output format</title>
</head>
<body>

<h1>Enzo output format</h1>
Although there are a number of ways of specifying when (and how often)
enzo outputs information, there is only one type of output 'dump' (well,
not quite -- there are now movie dumps, see below), which can also be used
to restart the simulation. The output format uses the following files,
each of which begins with the output name, here we use the example <tt>base_name</tt>,
and are then followed by the output number, ranging from 0000 to 9999 (if
more than 10000 grids are generated then the number goes to 10000, etc.).&nbsp;
When restarting, or other times when an output filename needs to be specified,
use the name without any extension (e.g. enzo -r base_name0000).
<br>&nbsp;
<ul>
<li>
<b>base_name0000</b> - This ascii file contains a complete listing of all
the parameter settings, both those specified in the initial parameter file,
as well as all those for which default values were assumed. The parameters
(see the section on <a href="parameters.html">parameters</a> for a discussion)
are in the same format as that used in the input file: <tt>parameter_name
= value</tt>. This file is modifiable if you would like to restart from
a certain point with different parameter values.</li>

<li>
<b>base_name0000.hierarchy</b> - This ascii file specifies the hierarchy
structure as well as the names of the grid files, their sizes, and what
they contain. It should not be modified and was not intended for general
human consumption.</li>

<li>
<b>base_name0000.grid0001</b> - The field information for each grid is
contain in separate files, one for each grid, numbering from 0001 to 9999.
The format is the Hierarchy Data Format (HDF), a self-describing machine-independent
data format developed and supported by the National Center for Supercomputing
Applications (NCSA). More information can be found on their <a href="http://hdf.ncsa.uiuc.edu">home
page</a>. Many scientific visualization packages support this format, including
IDL, AVS, IBM data explorer, xmgr, VFleet and viewit. Each field is stored
as it's own one-, two- or three-dimensional Scientific Data Set (SDS),
and is named for identification.&nbsp; Particles (if any) are included
with a set of one-dimensional SDS's.</li>

<li>
<b>base_name0000.boundary</b> - An ascii file which specifies boundary
information. It is not generally useful to modify.</li>

<li>
<b>base_name0000.boundary.hdf</b> - Contains field-specific boundary information,
in HDF format.</li>

<li>
<b>base_name0000.radiation</b> - This ascii file is only generated if using
the self-consistent radiation field.</li>
</ul>

<h3>
Output units</h3>
The units of the physical quantities in the grid SDS's are depend on the
problem being run.&nbsp; For most test problems there is no physical length
or time specified, so they can be be simply scaled.&nbsp; For cosmology
there are a set of units designed to make most quantities of order unity
(so single precision variables can be used).&nbsp; These units are defined
below (rho0 = 3*OmegaMatterNow*(100*HubbleConstantNow km/s/Mpc)^2/(8*Pi*G)).
<ul>
<li>
length: ComovingBoxSize/HubbleConstantNow * Mpc / (1+z)</li>

<li>
density: rho0 * (1+z)^3</li>

<li>
time: 1/sqrt(4*Pi*G*rho0*(1+InitialRedshift)^3)</li>

<li>
temperature: K</li>

<li>
velocity: (length/time)*(1+z)/(1+InitialRedshift) (this is z independent)
[This was corrected April 21/99 -- thanks to Chris Loken for pointing this
out].</li>
</ul>
The conversion factor is also given in the ascii output file (base_name0000):
search for DataCGSConversionFactor.&nbsp; Each field has its own conversation
factor, which converts that field to cgs units.
<p>
<hr WIDTH="100%">
<h3>
<a NAME="movie dumps"></a>Movie Dumps</h3>
There is now a (somewhat experimental) "movie" output.&nbsp; In fact, this
does not generate images per se (because of the difficulty in following
the multiple scales), but does output data that can be used to generate
movies.&nbsp; The data is a shortened version of the full output and is
intended to be compact, simple and fast.&nbsp; It cannot be used as a restart
file.

<p>If movie dumps are requested (i.e. the parameter dtMovieDump is non-zero),
then for each "movie" step, each processor generates 3 files (4 if star
particles are being used):
<p>MovieDataNNNNNN.gridP
<br>MovieDataNNNNNN.dmP
<br>MovieDataNNNNNN.starP
<br>MovieDataNNNNNN.summaryP
<p>Where NNNNNN (zero padded with at least six digits) is the number of
the little (movie) step and P is the processor number (not zero padded).&nbsp;
Example: MovieData000001.summary0.&nbsp; The summary file contains the
number of particles and additional information in ascii format.&nbsp;&nbsp;
Thus there is a total of 4*Nproc*Nstep files (Nproc is the number of processors
that enzo is being run with).
<p>Each of the grid, dm and star files contain a series of entries for
each "point" (whether it be a grid zone or particle):
<p>x, y, z, density, dx, [...]
<p>where each value is a 4 byte float and [...] indicates other information
specific to that kind of point (right now I have
<br>temperature &amp; metallicity for grid points and creation time &amp;
metallicity for star particles - the level can be worked out from dx).&nbsp;
Each processor only writes information that is local to it, so any image
generator must read all of the processor files.
<p>Greg Bryan has written a simple movie generator that reads this format and creates
a series of images (<a href="mailto:gbryan (AT) astro (dot) columbia (dot) edu">contact him</a> for this code), 
as well as giving an example
of how to read the data file format.&nbsp; The grid/dm/star particle files
are written in raw binary output (using C's fwrite command), so they may
not be readable on other machines besides the one that enzo was run on
(we should probably use John Shalf's IEEEIO...)&nbsp; Finally, this format
is subject to change without notice (in fact, everything in this guide
is subject to change without notice).
<p>


<p>&nbsp;</p>
<p>
<a href="../index.html">Go to the Enzo home page</a>
</p>

<hr WIDTH="100%">
<center>&copy; 2004 &nbsp; <a href="http://cosmos.ucsd.edu">Laboratory for Computational Astrophysics</a><br></center>
<center>last modified February 2004<br>
by <a href="mailto:bwoshea (AT) lanl.gov">B.W. O'Shea</a></center>

</body>
</html>
